<%@ page language="java" contentType="text/html; charset=utf-8" errorPage="/404.jsp" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>XX系统 - 房屋信息管理</title>
    <style type="text/css">
        @import url("<c:url value='/css/main.css'/>");
    </style>
</head>
<body>
<div class="div_main">
    <div class="div_header">房屋信息管理-房屋修改</div>

    <h1 align="center">
        <a href="${pageContext.request.contextPath}/house/list.action">
            返回首页
        </a>
    </h1>
    <c:if test="${not empty house}">
    <form action="${pageContext.request.contextPath}/house/updateOneByHid.action" method="post"
          enctype="multipart/form-data">
        <div class="div_data">
            <table class="tab_list">
                <tr>
                    <th>序号</th>
                    <th>地区</th>
                    <th>小区</th>
                    <th>单元</th>
                    <th>楼层</th>
                    <th>房号</th>
                    <th>面积</th>
                    <th>朝向</th>
                    <th>装修</th>
                    <th>是否有双气</th>
                    <th>限住人数</th>
                    <th>配套设施</th>
                    <th>日租</th>
                    <th>房屋状态</th>
                    <th>房屋图片</th>
                    <th>地址</th>
                    <th>添加时间</th>
                    <th>上次 信息修改时间</th>
                    <th>操作</th>
                </tr>
                <tr>
                    <td>
                            ${house.hid}
                        <input type="hidden" name="hid" value="${house.hid}">
                    </td>
                    <td>
                        <input type="text" name="harea" value="${house.harea}">
                    </td>
                    <td>
                        <input type="text" name="hcommunity" value="${house.hcommunity}">
                    </td>
                    <td>
                        <input type="text" name="hunitnumber" value="${house.hunitnumber}">
                    </td>
                    <td>
                        <input type="number" name="hfloor" value="${house.hfloor}">
                    </td>
                    <td>
                        <input type="text" name="hroomno" value="${house.hroomno}">

                    </td>
                    <td>
                        <input type="text" name="hacreage" value="${house.hacreage}">

                    </td>
                    <td>
                        <input type="number" name="hdirection" value="${house.hdirection}">
                    </td>
                    <td>
                        <input type="number" name="hfitment" value="${house.hfitment}">
                    </td>
                    <td>
                        <input type="number" name="hisdoubleair" value="${house.hisdoubleair}">
                    </td>
                    <td>
                        <input type="number" name="hlimit" value="${house.hlimit}">
                    </td>
                    <td>
                        <input type="text" name="hfacility" value="${house.hfacility}">
                    </td>
                    <td>
                        <input type="number" name="hprice" value="${house.hprice}">
                    </td>
                    <td>
                        <input type="number" name="hstatus" value="${house.hstatus}">
                    </td>

                    <td>
                        <input type="file" name="himg">
                        &nbsp;
                        <img src="${pageContext.request.contextPath}/image/${house.himg}" alt="${house.himg}"
                             width="20px" height="20px">
                    </td>
                    <td>
                        <input type="text" name="haddress" value="${house.haddress}">
                    </td>
                    <td>
                            ${house.haddtimeStr}
                    </td>
                    <td>
                            ${house.hupdatetimeStr}
                    </td>

                    <td>
                        <input type="reset" value="重填">
                        &nbsp;&nbsp;
                        <input type="submit" value="提交更改">
                        &nbsp;&nbsp;
                        <a href="#" onclick="confirmDelete(${house.hid})">删除</a>

                        <script>
                            function confirmDelete(id) {
                                if (confirm("确定要删除码？")) {
                                    window.location="${pageContext.request.contextPath}/house/deleteOneByHid.action?hid=" + id;
                                    // 重定向
                                }
                                return false;
                            }
                        </script>
                    </td>
                </tr>


            </table>
        </div>
        </c:if>

    </form>


</div>
</body>
</html>